$(function () {
    $("#div2").hide()

    $("#cxsy").bootstrapTable({
        method:"post",
        contentType:'application/json',
        url:"/Kucun/cxsy",
        striped:true,
        pageNumber:1,
        pagination:true,
        sidePagination:'server',
        pageSize:3,
        pageList:[2,3,5,6],
        queryParams:function (parmes) {
            return{
                pageNum:(parmes.offset / parmes.limit) + 1,
                pageSize:parmes.limit,
                registerTime:$("#registerTime").val(),
                checker:$("#checker").val(),
            }
        },
        columns:[
            {title:"配置单编号",field:"storeId",align:'center'},
            {title:"产品编号",field:"productId",align:'center'},
            {title:"产品名称",field:"productName",align:'center'},
            {title:"配置单状态",field:"secondKindName",align:'center',
                formatter:function () {
                    return "完成";
                }},
            {title:"复核状态",field:"checkTag",align:'center',
                formatter:function (value,row,index) {
                    if (value==0){
                        return "<font color=\"orange\">等待审核</font>"
                    }if (value==1){
                        return "<font color=\"green\">通过审核</font>"
                    }if (value==2){
                        return  "<font color=\"red\">不通过审核</font>"
                    }
                }
            },
            {title:"查看",field:"id",align:'center',
                formatter:function (value,row,index) {
                    let kk="<button href='#' onclick='ckkyx("+JSON.stringify(row)+")' class=\"btn btn-primary\">查看</button>";
                    return kk;
                }
            },
        ]
    })
})

function cxyx() {
    $("#cxsy").bootstrapTable("refresh");
}

function ckkyx(row) {

    $("#div1").hide()
    $("#div2").show()

    $("#name").html(row.productName);
    $("#pzdbh").html(row.storeId);
    $("#bh").html(row.productId);
    $("#bjxx").html(row.minAmount);
    $("#bjsx").html(row.maxAmount);
    $("#ccl").html(row.maxCapacityAmount);
    $("#sjr").html(row.register);
    $("#fhr").html(row.checker);
    $("#fhsj").html(row.registerTime);
    $("#comment").val(row.config);

}

function fhsm() {
    $("#div1").show()
    $("#div2").hide()
}